package process.grammar;

import org.antlr.runtime.ANTLRStringStream;
import org.antlr.runtime.CharStream;
import org.antlr.runtime.CommonTokenStream;
import org.antlr.runtime.RecognitionException;
import org.antlr.runtime.TokenStream;

import process.gen.ProcessLexer;
import process.gen.ProcessParser;
import process.visitor.Visitor;
import process.visitor.VisitorImpl;

public class TestProcess {
	public static void main(String[] args) throws RecognitionException {
		CharStream charStream = new ANTLRStringStream("process scrum {\n"
				+ "	workflow task{\n" + "		a = b,c->d \n" + "	}\n"
				+ "	workflow bug{\n" + "		a = b,c->d r,o->q \n"
				+ "		e = g,h->k \n" + "	}\n" + "}");
		ProcessLexer lexer = new ProcessLexer(charStream);
		TokenStream tockenStream = new CommonTokenStream(lexer);
		ProcessParser parser = new ProcessParser(tockenStream);
		process.ast.Process process = parser.process();
		Visitor visitor = new VisitorImpl();
		process.accept(visitor);
	}
}